﻿Imports System.Collections.Generic

Public Class FrmSelectMultipleProjects

  Private projects As New List(Of ProjectHolder)

  Sub InitWithProjects(projects As ProjectHolderCollection, questionTitle As String)

    Me.lblTitle.Text = questionTitle

    For Each project In projects
      Me.projects.Add(project)
      lstProjects.Items.Add(project.FullName)
    Next

  End Sub

  ReadOnly Property SelectedProjects As ProjectHolderCollection
    Get
      Dim ret As New ProjectHolderCollection

      For Each index As Integer In lstProjects.CheckedIndices
        ret.Add(projects.Item(index))
      Next

      Return ret
    End Get
  End Property

End Class